package hnlg.com.cn.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import hnlg.com.cn.mapper.UnitMapper;
import hnlg.com.cn.service.UnitService;
import hnlg.com.cn.vo.Unit;

@Service("unitService")
@Transactional(value="txManager",rollbackFor=Exception.class)
public class UnitServiceImpl implements UnitService {
    @Autowired
	UnitMapper obj;
	
	@Override
	public boolean addUnit(Unit unit) throws Exception {
		
		return obj.addUnit(unit);
	}

	@Override
	public boolean deleteUnit(int id) throws Exception {
		
		return obj.deleteUnit(id);
	}

	@Override
	public boolean updateUnit(Unit unit) throws Exception {
		
		return obj.updateUnit(unit);
	}

	@Override
	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public List<Unit> queryUnit(Unit unit) throws Exception {
		
		return obj.queryUnit(unit);
	}

	@Override
	public boolean deleteBatch(String[] arr) throws Exception {
		
		return obj.deleteBatch(arr);
	}

}
